package cloud.xlh.intergration.file.adapter;

import cloud.xlh.client.file.dto.FileHandleDTO;
import cloud.xlh.client.file.dto.MountSettingDTO;
import cloud.xlh.domain.file.domain.FileSaveDomain;
import cloud.xlh.domain.file.domain.MountSettingSaveDomain;
import cloud.xlh.domain.file.domain.MountSettingUpdateDomain;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/8/5 15:23
 * @ Description:
 */
@Component
public class FileClientAdapter {
    public FileSaveDomain convertFileSaveDomain(FileHandleDTO fileHandleDTO) {
        FileSaveDomain fileSaveDomain = new FileSaveDomain();
        fileSaveDomain.setLocalPath(fileHandleDTO.getLocalPath());
        fileSaveDomain.setRemotePath(fileHandleDTO.getRemotePath());
        return fileSaveDomain;
    }

    public MountSettingSaveDomain convertMountSettingSaveDomain(MountSettingDTO mountSettingDTO) {
        MountSettingSaveDomain mountSettingSaveDomain = new MountSettingSaveDomain();
        mountSettingSaveDomain.setMpLocalDirPath(mountSettingDTO.getMpLocalDirPath());
        mountSettingSaveDomain.setMpRemoteDirPath(mountSettingDTO.getMpRemoteDirPath());
        return mountSettingSaveDomain;
    }

    public MountSettingUpdateDomain convertMountSettingUpdateDomain(MountSettingDTO mountSettingDTO) {
        MountSettingUpdateDomain mountSettingUpdateDomain = new MountSettingUpdateDomain();
        mountSettingUpdateDomain.setMpLocalDirPath(mountSettingDTO.getMpLocalDirPath());
        mountSettingUpdateDomain.setMpRemoteDirPath(mountSettingDTO.getMpRemoteDirPath());
        return mountSettingUpdateDomain;
    }
}
